﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Graphics;
using Imagine;
using  Carmack;

namespace Carmack
{
    class TestScreen : GameScreen
    {
       SimpleSprite ground;
       public override bool Init(object extraData)   //Any data that needs to be passed from One State to another
       {
              GameManager.Instance().CreateHero("look", true);
              ground = new SimpleSprite( "grnd" );
              TheWorld.Instance().Add( ground, 0 );

           return true;
       }     
       public override bool Draw(GameTime gameTime, SpriteBatch _spritebatch)  
       {
           Engine.Instance().GraphicsDevice.Clear(Color.White);
           return true;
       }
       public override bool Update(GameTime gameTime)                              
       {
           if (TheInputManager.Instance().IsKeyDown(Keys.Enter))
           { 
               NetworkManager.Instance().CreateSession();
               TheScreenManager.Instance().SetScreen( (int)eGameScreens.GamePlayScreen, (int)eScreenState.DEAD, null );
           }
           if (TheInputManager.Instance().IsKeyDown(Keys.D1))
           { 
               GameManager.Instance().MyHero.SetState(eHeroState.Default);
           }  
           if (TheInputManager.Instance().IsKeyDown(Keys.D2))
           { 
               GameManager.Instance().MyHero.SetState(eHeroState.Carrying);
           }  
           return true;
       }
       public override bool Release()                                              {return true;} 
    }
}
